<!-- Logo -->
@php
    use Illuminate\Support\Facades\Auth;
    use App\Modules\User\Models\Admin;
    $user = Auth::user();
@endphp
<a href="/admin" class="logo">
    <!-- logo for regular state and mobile devices -->
    <span class="logo-lg"><b>珠影</b>天成</span>
</a>

<!-- Header Navbar -->
<nav class="navbar navbar-static-top" role="navigation">
    <!-- Sidebar toggle button-->
    <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
    </a>
    <!-- Navbar Right Menu -->
    <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
            <!-- User Account Menu -->
            @auth
                @if ($user->is_merchant_staff == Admin::MERCHANT_AUTH) {{-- 如果是1的话，则是商家职员 --}}

                @else
                    <li class="dropdown notifications-menu">
                        <!-- Menu Toggle Button -->
                        @php
                            $count=\App\Modules\Comment\Models\Comment::query()->where("read_noread",0)->where('is_delete', 0)->where('pid', 0)->count();
                        @endphp
                        <a href="{{ route('admin.comment.index',["read_no_read"=>0]) }}" class="dropdown-toggle"
                           data-toggle="message">
                            <i class="fa fa-bell"></i> <span class="pull-right-container"><small
                                    class="badge pull-right bg-red">{{$count}}</small></span>
                        </a>
                    </li>
                @endif


                <li class="dropdown notifications-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ Auth::user()->name }}</a>
                    <ul class="dropdown-menu">
                        <li>
                            <ul class="menu">
                                <li><a href="{{ route('admin.password.from') }}">修改密码</a></li>
                                <li><a href="{{ route('admin.logout') }}">退出</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>

            @endauth
        </ul>
    </div>
</nav>
